package com.fun.demo.fun;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;
import java.util.Date;

public class DateTest {

    public static void main(String[] args) {

     /*   LocalDateTime now = LocalDateTime.now();
        System.out.println(now);
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        String oo = df.format(now);
        TemporalAccessor o =DateTimeFormatter.ofPattern("yyyy-mm-dd").parse("2015-09-08");
        System.out.println(oo);
        LocalDateTime ooo = LocalDateTime.parse(oo,df);
        System.out.println(ooo);*/

        Date d = new Date();
        System.out.println(d.toString());

        LocalDateTime ll = LocalDateTime.ofInstant(d.toInstant(), ZoneId.systemDefault());
        System.out.println(ZoneId.systemDefault());
        Date dd =  Date.from(ll.toInstant(ZoneOffset.of("+8")));
        System.out.println(dd.toString());

    }
}
